Add shared structtag package for use across features#1120
Merged
Conversation
5c54adb to
dfa9fae
Compare
Contributor
Author
|
Renamed this from |
structfield package for use across featuresstructtag package for use across features
bgentry
approved these changes
Jan 11, 2026
Contributor
bgentry
left a comment
There was a problem hiding this comment.
Looks great, with the caveat that this isn't in rivershared and thus can't be utilized by riverpro.
dfa9fae to
cc074fc
Compare
Contributor
Author
Ah, what the heck. I must've added the folder in the wrong place. My pro changes seem to import the package, but I guess I must've forgotten to run the tests there. Fixed! |
68189cd to
338de47
Compare
brandur
commented
Jan 11, 2026
|
|
||
| // SortedFieldsWithTag retrieves unique fields with caching to avoid | ||
| // extracting fields from the same struct type repeatedly. | ||
| func SortedFieldsWithTag(args rivertype.JobArgs, tagValue string) ([]string, error) { |
Contributor
Author
There was a problem hiding this comment.
Also renamed this from GetSortedTagFieldsCached to SortedFieldsWithTag. Seems a little better for a public API name.
Here, introduce a new `rivershared/structtag` package, extracted from some of the previous implementation of `dbunique`. We modify the previous implementation so that it can handle `river` tag values with any arbitrary value (previously, only `unique` worked) so that we can reuse the implementation or other features.
338de47 to
ed31354
Compare
Contributor
Author
|
thx! Verified this works with River Pro. |
brandur
added a commit
that referenced
this pull request
Jan 12, 2026
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120).
brandur
added a commit
that referenced
this pull request
Jan 12, 2026
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120). [skip ci]
brandur
added a commit
that referenced
this pull request
Jan 12, 2026
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120). [skip ci]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here, introduce a new
rivershared/structtagpackage, extracted fromsome of the previous implementation of
dbunique. We modify theprevious implementation so that it can handle
rivertag values withany arbitrary value (previously, only
uniqueworked) so that we canreuse the implementation or other features.